<?xml version="1.0" encoding="utf-8" ?>
<Mapping xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	
	<!-- 
		Les entités sont décrite spécifiquement
			- leurs attributs sont spécifiques
			- et leurs relations sont génériques
	-->
	
	<Entity type="ValueTypes" table="ValueTypes">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="decimal" db-type="Decimal" scale="17" precision="38" />
		<Attribute name="uint" db-type="Int64" />
		<Attribute name="byte" db-type="Byte" />
		<Attribute name="ulong" db-type="Binary" size="1024" />
		<Attribute name="string" db-type="AnsiString" size="255" />
		<Attribute name="int" db-type="Int32" />
		<Attribute name="ushort" db-type="Int32" />
		<Attribute name="bool" db-type="Boolean" />
		<Attribute name="double" db-type="Double" />
		<Attribute name="sbyte" db-type="Int16" />
		<Attribute name="long" db-type="Int64" />
		<Attribute name="short" db-type="Int16" />
		<Attribute name="float" db-type="Single" />
		<Attribute name="char" db-type="AnsiStringFixedLength" size="1" />
		<Attribute name="object" db-type="Object" />
		<Attribute name="object2" db-type="Object" />
	</Entity>
	
	<Entity type="Person" table="Person">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="Age" field="Age" db-type="Int32" />
		<Attribute name="Lastname" field="Lastname" db-type="AnsiString" size="255" />
		<Attribute name="Firstname" field="Firstname" db-type="AnsiString" size="255" />
		<Attribute name="Acceleration" field="Acceleration" db-type="Decimal" scale="17" precision="38"/>
	
		<Reference name="*" entityChild="Person" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Person" childField="Id" />
		</Reference>
		
		<Reference name="Address" entityChild="Address" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Address" childField="Id" />
		</Reference>
		
		<Reference name="Friend" entityChild="Thing" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Thing" childField="Id" />
		</Reference>
		
		<Reference name="BestFriend" entityChild="Person">
			<Rule parentField="FK_BestFriend" childTable="Person" childField="PersonId" />
		</Reference>
		
		<Reference name="MyCompany" entityChild="Company" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Company" childField="Id" />
		</Reference>
		
	</Entity>
	
	<Entity type="Employee" table="Employee">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="Age" field="Age" db-type="Int32" />
		<Attribute name="Lastname" field="Lastname" db-type="AnsiString" size="255" />
		<Attribute name="Firstname" field="Firstname" db-type="AnsiString" size="36" />
		<Attribute name="Acceleration" field="Acceleration" db-type="Decimal" scale="14" precision="28"/>
		<Attribute name="Salary" field="Salary" db-type="Double"/>	
		
		<Reference name="*" entityChild="Person" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Person" childField="Id" />
		</Reference>
		
		<Reference name="Address" entityChild="Address" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Address" childField="Id" />
		</Reference>
		
		<Reference name="Friend" entityChild="Thing" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Thing" childField="Id" />
		</Reference>
		
		
		<Reference name="MyCompany" entityChild="Company" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Company" childField="Id" />
		</Reference>
	</Entity>
	
	<Entity type="Worker" table="Worker">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="Age" field="Age" db-type="Int32" />
		<Attribute name="Lastname" field="Lastname" db-type="AnsiString" size="255" />
		<Attribute name="Firstname" field="Firstname" db-type="AnsiString" size="36" />
		<Attribute name="Acceleration" field="Acceleration" db-type="Decimal" scale="14" precision="28"/>
		<Attribute name="Salary" field="Salary" db-type="Double"/>	
		<Attribute name="Place" field="Place" db-type="String"/>	
		<Reference name="*" entityChild="Person" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Person" childField="Id" />
		</Reference>
		
		<Reference name="Address" entityChild="Address" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Address" childField="Id" />
		</Reference>
		
		<Reference name="Friend" entityChild="Thing" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Thing" childField="Id" />
		</Reference>
		
		
		<Reference name="MyCompany" entityChild="Company" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Company" childField="Id" />
		</Reference>
	</Entity>
	
	<Entity type="Secretary" table="Secretary">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="Age" field="Age" db-type="Int32" />
		<Attribute name="Lastname" field="Lastname" db-type="AnsiString" size="255" />
		<Attribute name="Firstname" field="Firstname" db-type="AnsiString" size="36" />
		<Attribute name="Acceleration" field="Acceleration" db-type="Decimal" scale="14" precision="28"/>
		<Attribute name="Salary" field="Salary" db-type="Double"/>	
		<Attribute name="Bonus" field="Bonus" db-type="Int32"/>	
		
		<Reference name="*" entityChild="Person" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Person" childField="Id" />
		</Reference>
		
		<Reference name="Address" entityChild="Address" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Address" childField="Id" />
		</Reference>
		
		<Reference name="Friend" entityChild="Thing" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Thing" childField="Id" />
		</Reference>
		
		
		<Reference name="MyCompany" entityChild="Company" discriminator-field="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Company" childField="Id" />
		</Reference>
	</Entity>
	
	<Entity type="Address" table="Address">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="City" field="City" db-type="String"/>	
	</Entity>
	
	<Entity type="Thing" table="Thing">
		<Id field="Id" ><Generator name="guid" /></Id>
		
		<Attribute name="Firstname" field="Firstname" db-type="AnsiString" size="255" />
		<Attribute name="Lastname" field="Lastname" db-type="AnsiString" size="255" />
	</Entity>
	
	<Entity type="FlaggedCategory" table="FlaggedCategory">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="FlaggedCategory" field="FlaggedCategory" db-type="AnsiString" size="255" />
	</Entity>
	
	<Entity type="Category" table="Category">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="Category" field="Category" db-type="Int32" />
	</Entity>
	
	<Entity type="Manager" table="Manager">
		<Id field="Id" ><Generator name="guid" /></Id>
		
		<Reference name="*" entityChild="Company">
			<Rule parentField="FK_Company" childTable="Company" childField="Id" />
		</Reference>
		
	</Entity>
	
	<Entity type="Company" table="Company">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="Name" field="Name" db-type="AnsiString" size="255" />
		
	</Entity>
	
	<Entity type="ComplexTypes" table="ComplexTypes">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="array2" field="array2" db-type="Binary" size="1024" />
		<Attribute name="array1" field="array1" db-type="Binary" size="1024" />
		<Attribute name="datetime" field="datetime" db-type="DateTime" />
		<Attribute name="timespan" field="timespan" db-type="Object" />
	</Entity>
	
	<Entity type="SerializableTypes" table="SerializableTypes">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="StringCollection" field="StringCollection" db-type="Binary" size="1024" />
	</Entity>
	
	<Entity type="B" table="B">
		<Id field="Id" >
			<Generator name="guid" />
		</Id>
		<Attribute name="a" field="a" db-type="AnsiString" size="255" />
		<Attribute name="b" field="b" db-type="AnsiString" size="255" />
	</Entity>
	
	<Entity type="C" table="C">
		<Id field="Id" >
			<Generator name="guid" />
		</Id>
		<Attribute name="a" field="a" db-type="AnsiString" size="255" />
		<Attribute name="c" field="c" db-type="AnsiString" size="255" />
	</Entity>
	
</Mapping>